﻿#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_NpcapTest.h"
#include "./Include/pcap.h"
#include <QNetworkInterface>
#include <QMessageBox>
#include <thread>
#include <future>

//!设置文本为UTF-8
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif

class NpcapTest : public QMainWindow
{
    Q_OBJECT

public:
    NpcapTest(QWidget *parent = nullptr);
    ~NpcapTest();

private:
    Ui::NpcapTestClass ui;

private slots:
	void on_pushButton_OpenNet_clicked();
	void on_pushButton_CloseNet_clicked();
	void on_pushButton_SendPack_clicked();
	void on_pushButton_BeginSend_clicked();
	void on_pushButton_StopSend_clicked();
	void on_comboBox_SelNet_currentIndexChanged(const QString& text);
	void on_pushButton_InitNetList_clicked();
	void on_pushButton_BeginRecieve_clicked();
	void on_pushButton_StopRecieve_clicked();
private:
	pcap_t* m_adapterHandle;//适配器句柄
	bool m_bSendPackThreadExit;
	std::future<void> m_SendPackFuture;
	bool m_bCathPackThreadExit;
	std::future<void> m_CathPackFuture;
signals:

};
